using System.Collections;
using System.Collections.Generic;
using NodeCanvas.Framework;
using UnityEngine;
using Yoozoo.Gameplay.Liberty.AI;
using Yoozoo.Gameplay.Liberty.AI.Node;

namespace com.yoozoo.gta
{
    public class NpcGetLastPosition : AIBaseNode
    {
        public BBParameter<Transform> TargetTransform;
        public BBParameter<Vector3> TargetPosition;
        public BBParameter<TargetType> targetType = TargetType.CurrentLockTarget;
        protected override void OnExecute()
        {
            base.OnExecute();
            AIEntity target = _entity.battleAgent.GetTarget(targetType.value);

            TargetTransform.value = target.viewer.viewerRoot;
            TargetPosition.value = target.data.CurrentLerpPositin;
            
            EndAction(true);
        }
    }
}
